from flask import Flask
from models import db
from view.user import user_bp
from flask_cors import CORS
from view.oauth_user import oatuh_user_bp
from view.weibo_oauth_user import oatuh_weibo_bp
from view.courses import courses_bp
from view.comments import comments_bp
from view.qiniuyun import qiniu_bp
from view.vip import vip_bp
def create_flask_app(config):
    app = Flask(__name__)
    app.config.from_object(config)
    db.init_app(app)
    cors = CORS(app)
    app.register_blueprint(user_bp)
    app.register_blueprint(oatuh_user_bp)
    app.register_blueprint(oatuh_weibo_bp)
    app.register_blueprint(courses_bp)
    app.register_blueprint(comments_bp)
    app.register_blueprint(qiniu_bp)
    app.register_blueprint(vip_bp)


    return app